<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page contentType="text/html; charset=UTF-8" language="java"%>
<%@page import="com.kcs.common.utils.commonUtils"%>
<%@page import="com.kcs.common.utils.PropsUtils"%>
<%@page import="com.kcs.common.utils.Constant"%>

<html>
<head>
<title>FX Margin - SETUP ROLE PROFILE</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
<script type="text/javascript" src="jsp/script/jquery/plugin/fancybox/jquery.easing-1.3.pack.js"></script>
<script type="text/javascript" src="jsp/script/jquery/plugin/fancybox/jquery.fancybox-1.3.4.js"></script>
<script type="text/javascript" src="jsp/script/jquery/plugin/fancybox/jquery.fancybox-1.3.4.pack.js"></script>   
<script type="text/javascript" src="jsp/script/jsDatePick.full.1.3.js"></script>   	
<script type="text/javascript" src="jsp/script/common.js"></script>  
<link rel="stylesheet" type="text/css" href="jsp/script/jquery/plugin/fancybox/jquery.fancybox-1.3.4.css"/>
<link rel="stylesheet" type="text/css" href="jsp/css/table.css"/>
<link rel="stylesheet" type="text/css" href="jsp/css/jsDatePick_ltr.css" />
<link href="jsp/css/fxmarginStyle.css" rel="stylesheet" type="text/css" />
<link href="jsp/css/table.css" rel="stylesheet" type="text/css" />


<script type="text/javascript">
	function saveRoleProfile(){
		var tranCode = document.getElementsByName("tranCode")[0];
		var btnSave = document.getElementsByName("btnSave")[0];

		updateAllFlagValues();
		
		tranCode.value = "saveRoleProfile";
		
		document.forms[0].submit();

		btnSave.disabled = true;
		loading();
	}

	function updateFlagValue(cb){
		var splt = cb.id.split("_");
		var checkBoxIndex = splt[1];
		var authFlagHidden = document.getElementById("authFlagList_"+checkBoxIndex);

		if(cb.checked){
			authFlagHidden.value = "1";
		}else{
			authFlagHidden.value = "0";
		}
	}

	function updateAllFlagValues(){
		var cb = document.getElementsByName("cbAuthFlagList");
		var hd = document.getElementsByName("authFlagList");
		
		for(var i=0; i<cb.length; i++){
			updateFlagValue(cb[i]);
		}
	}

</script>

</head>
<body>
	<!-- HEADER MENU -->
	<%@ include	file="include/headerMenu.jsp"%> 

	<table width="100%" border="0" cellspacing="0" cellpadding="0">
		
		<!-----------------------------  BODY  ---------------------------------->
		<tr>
			<td>
				<table width="100%" class="MarginHeader" style="text-align: left;">
					<tr>
						<td>
							Setup Role Profile
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td width="100%" valign="top">
				<form id="setupRoleProfileForm" method="post" action="SetupRoleProfileAction.do" onsubmit="return false">
					<input type="hidden" name="tranCode" value=""/>
				
					</br>
					<center>
						<table width="80%" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td>
									<%
										Object err = request.getAttribute(Constant.ERR_ATTR);
										if(err != null){
											%>
												<script type="text/javascript">
													alert("<%=err%>");
												</script>
											<%
											
										}
									%>
								</td>
							</tr>
							<tr>
								<td>
									<%
										Object html = request.getAttribute(Constant.FUCTION_LIST_ATTR);
										if(html != null){
											out.print(html);
										}
									%>
								</td>
							</tr>
							
						</table>
					</center>
					
					<%@ include	file="include/footer.jsp"%> 
				</form>
			</td>
		</tr>
	</table>
</body>
</html>